﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace MyFinanceManager.Objects
{
    public class AccountRecord : Record
    {
        public string Description { get; set; }
        public Account Account { get; set; }
        public string AccountName { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(base.ToString());
            sb.Append("Account: ");
            if (this.Account != null)
            {
                sb.AppendLine(this.Account.ToString());
            }
            else
            {
                sb.AppendLine(this.AccountName);
            }

            if (!String.IsNullOrEmpty(this.Description))
            {
                sb.Append("Description: ");
                sb.AppendLine(this.Description);
            }
            return sb.ToString();
        }
    }
}
